import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import pinia from '@/stores/index.js'
import '@/assets/main.scss'
import ElementPules from 'element-plus'
import * as ElIcons from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'



const app = createApp(App)
// 全局挂载和注册 element-plus 的所有 icon
app.config.globalProperties.$icons = []
for (const [key, component] of Object.entries(ElIcons)) {
    app.config.globalProperties.$icons.push(key)
    app.component(key, component)
}



app.use(pinia)
app.use(ElementPules)
app.use(router)
app.mount('#app')
app.use(ElementPules, {
  locale: zhCn,
})
for (const name in ElIcons) {
    app.component(name, ElIcons[name])
}